package com.jmp.dto;

import lombok.Builder;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

@Data
@Builder
public class TenxunImReceiveResponse {
    private String ActionStatus;
    private String ErrorInfo;
    private Integer ErrorCode;

    public static TenxunImReceiveResponse success() {
        return TenxunImReceiveResponse.builder()
                .ActionStatus("OK")
                .ErrorInfo(StringUtils.EMPTY)
                .ErrorCode(0)
                .build();
    }

    public static TenxunImReceiveResponse fail(String msg) {
        return TenxunImReceiveResponse.builder()
                .ActionStatus("FAIL")
                .ErrorInfo(StringUtils.defaultIfBlank(msg, "回调出错"))
                .ErrorCode(1)
                .build();
    }
}
